<script setup>
import StudentHomeWork from "@/views/Student/StudentHomeWork.vue";
import TeacherHomeWork from "@/views/Teacher/TeacherHomeWork.vue";
import {getStorage} from "@/utils/localStorage.js";

// 根据登录信息判断用户身份
let userData=JSON.parse(getStorage("userInfo"));
console.log('userData',userData)
console.log('userDataRole')
const userRole = userData.user.role; // 假设从后端获取的用户角色信息
const isTeacher = userRole === '老师';

</script>

<template>
  <div>
    <template v-if="isTeacher">
      <TeacherHomeWork/>
    </template>
    <template v-else>
      <StudentHomeWork/>
    </template>
  </div>
</template>

<style scoped>

</style>